#include <jni.h>
#include <opencv2/opencv.hpp>
#include <android/bitmap.h>
#include "IDCardReader.h"
#include "bitmat.h"

using namespace cv;

JavaVM* javaVm;
JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved){
    javaVm = vm;
    return JNI_VERSION_1_4;
}
extern "C"
JNIEXPORT void JNICALL
Java_com_frameworkc_opencv_IDCardReader_idcardreader(JNIEnv *env, jobject thiz, jobject src,
                                                     jobject dest) {
    IDCardReader* idCardReader = new IDCardReader();
    Mat srcMat;
    Mat destMat;
    bitmat* bitmat = new class bitmat();
    bitmat->BitmapToMat(env,src,srcMat);
    bitmat->BitmapToMat(env,dest,destMat);
    idCardReader->readIdNoString(srcMat,destMat);
    bitmat->MatToBitmap(env,dest,destMat);
}